<!-- 话题详情最热评论 -->
<template>
	<view class="content">
		<view class="haveReply" v-if='Datalist.hostlist.length>0'>
			<view class="replayItem" v-for='(item,index) in Datalist.hostlist' :key='index'>
				<image :src="item.avatar"></image>
				<view class="rightBox">
					<view class="nicknameBox">
						<view class="left">
							<text>{{item.nickname}}</text>
							<view class="author" v-if='item.isAuthor'>作者</view>
						</view>
						<view class="right">
							<image src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/topicIcon/_img1.png"></image>
							<text>{{item.goods}}</text>
						</view>
					</view>
					<view class="speak">{{item.speak}}</view>
					<view class="ip_box">
						<view class="time">{{item.time}}</view>
						<view>{{'IP:'+item.ip}}</view>
						<text>回复</text>
					</view>
					<view class="itemReply" v-if='replyIndex==index&&show'>
						<view class="item1" v-for='(item1,index1) in item.reply' :key='index1'>
							<image :src="item1.avatar"></image>
							<view class="right">
								<view class="box1">{{item1.nickname}}</view>
								<view class="box2">{{item1.speak}}</view>
								<view class="box3">
									<view class="time">{{item1.time}}</view>
									<view>{{'IP:'+item1.ip}}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="packOran">
						<view class="boe" v-if="!show||replyIndex!==index" @click="$emit('ShowReply',index)">
							<view>展开{{item.reply.length}}条回复</view>
							<image src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/topicIcon/_img4.png"></image>
						</view>
						<view class="boe" v-if='replyIndex==index&&show'  @click="$emit('ShowReply',index)">
							<text>收起</text>
							<image src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/topicIcon/_img6.png"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="empty" v-else>
			<image src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/topicIcon/empty.png"></image>
			<text>评论还是空空的，快来说两句吧~</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "",
		components: {

		},
		props: {
			Datalist:Object,
			show:{
				type:Boolean,
				default:false
			},
			replyIndex:Number
		},
		data() {
			return {}
		},
		methods: {

		},
		mounted() {

		},
		onLoad() {

		},
		computed: {

		},
		watch: {

		}
		
	}
</script>

<style scoped lang="scss">
.content{
	
	.haveReply{
		width: 100%;
		// border: 1rpx solid red;
		.replayItem{
			display: flex;
			&>image{
				width: 72rpx;
				height: 72rpx;
				border-radius: 50%;
			}
			.rightBox{
				width: 90%;
				padding: 0 0 0 16rpx;
				// border: 1rpx solid black;
				.nicknameBox{
					display: flex;
					justify-content: space-between;
					align-items: center;
					.left{
						font-size: 26rpx;
						font-family: Source Han Sans CN;
						color: #747474;
						display: flex;
						align-items: center;
						.author{
							width: 76rpx;
							height: 42rpx;
							border: 2rpx solid #194FC9;
							border-radius: 20rpx;
							font-size: 24rpx;
							font-weight: 500;
							color: #369CFE;
							line-height: 42rpx;
							text-align: center;
							margin-left: 14rpx;
						}
					}
					.right{
						display: flex;
						align-items: center;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #999999;
						&>image{
							width: 32rpx;
							height: 32rpx;
							margin-right: 10rpx;
						}
					}
				}
				.speak{
					padding: 6rpx 80rpx 20rpx 0;
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					color: #2B2B2B;
				}
				.ip_box{
					display: flex;
					align-items: center;
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #B4B4B4;
					margin-bottom: 40rpx;
					.time{
						padding: 0 18rpx 0 0;
					}
					&>text{
						font-family: Source Han Sans CN;
						color: #878787;
						padding: 0 0 0 72rpx;
					}
				}
				.itemReply{
					width: 100%;
					// border: 1rpx solid blue;
					.item1{
						display: flex;
						
						&>image{
							width: 20px;
							height: 20px;
							border-radius: 50%;
							
						}
						.right{
							width: 100%;
							padding: 0 20rpx 0 16rpx;
							.box1{
								font-size: 13px;
								font-family: Source Han Sans CN;
								color: #747474;
							}
							.box2{
								font-size: 15px;
								font-family: Source Han Sans CN;
								color: #2B2B2B;
								padding: 14rpx  80rpx 24rpx 0;
							}
							.box3{
								display: flex;
								align-items: center;
								font-family: PingFang SC;
								font-size: 13px;
								font-weight: 500;
								color: #B4B4B4;
								margin-bottom: 40rpx;
								.time{
									padding: 0 18rpx 0 0;
								}
							}
						}
					}
				}
				.packOran{
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 500;
					color: #878787;
					.boe{
						display: flex;
						align-items: baseline;
						margin-bottom: 50rpx;
						&>image{
							width: 24rpx;
							height: 14rpx;
							margin-left: 8rpx;
						}
					}
				}
			}
		}
	}
	.empty{
		font-size: 28rpx;
		font-family: Source Han Sans CN;
		color: #595A5A;
		display: flex;
		flex-direction: column;
		align-items: center;
		&>image{
			width: 448rpx;
			height: 394rpx;
			margin-bottom: 22rpx;
		}
	}
}
</style>
